#pragma once
/*
 * Created by: Mark Lavrynenko
 * Email:	MarkLavrinenko@gmail.com
 * Project:	  Huffman
*/

#include "datatarget.h"
#include <stdio.h>

class FileDataTarget :
	public DataTarget
{
public:
	FileDataTarget(char const* fileName);
	virtual ~FileDataTarget(void);
	virtual bool putNextByte(uint8_t next);
	virtual bool putNextInt16(int16_t next);
	virtual bool putNextInt32(int32_t next);
	virtual bool putNextBit(const bool &value);
	virtual bool putBitSequence(const vector<char> &bits);
	virtual void finishByte();
private:
	FILE* f;
	size_t haveBits;
	uint8_t byte;
};